package com.ruoyi.bizsys.mapper;

import java.util.List;

import com.ruoyi.bizsys.domain.UserActivityGroup;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.bizsys.query.UserActivityGroupQuery;
import com.ruoyi.bizsys.vo.UserActivityGroupVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * 【请填写功能名称】Mapper接口
 *
 * @author african-loan
 * @date 2022-06-23
 */
public interface UserActivityGroupMapper extends BaseMapper<UserActivityGroup>{

    @Update("UPDATE user_activity_group SET award_group_code = #{awardGroup} WHERE user_id = #{userId} and (award_group_code is null or award_group_code = '')")
    int saveAwardGroup(@Param("userId") String userId,@Param("awardGroup") String awardGroup);

    List<UserActivityGroupVO> selectUserActivityGroupList(UserActivityGroupQuery userActivityGroupQuery);

    @Insert("INSERT user_activity_group (user_id,award_group_code)VALUES(#{userId},#{awardQualiFied})")
    int insertUserActivityGroup(@Param("userId") String userId,@Param("awardQualiFied") String awardQualiFied);
}
